/*     */ package com.zimbra.cs.account.ldap;
/*     */ 
/*     */ import com.zimbra.common.service.ServiceException;
/*     */ import com.zimbra.cs.account.AttributeClass;
/*     */ import com.zimbra.cs.account.Config;
/*     */ import com.zimbra.cs.account.Provisioning;
/*     */ import java.io.PrintStream;
/*     */ import java.util.LinkedHashSet;
/*     */ import java.util.Set;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class LdapObjectClass
/*     */ {
/*  37 */   public static String ZIMBRA_DEFAULT_PERSON_OC = "inetOrgPerson";
/*     */   
/*     */   private static void addExtraObjectClasses(Set<String> ocs, Provisioning prov, String extraOCAttr) throws ServiceException
/*     */   {
/*  41 */     String[] extraObjectClasses = prov.getConfig().getMultiAttr(extraOCAttr);
/*  42 */     for (String eoc : extraObjectClasses) {
/*  43 */       ocs.add(eoc);
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static Set<String> getAccountObjectClasses(Provisioning prov, boolean zimbraDefaultOnly)
/*     */     throws ServiceException
/*     */   {
/*  56 */     Set<String> ocs = new LinkedHashSet();
/*     */     
/*  58 */     ocs.add(ZIMBRA_DEFAULT_PERSON_OC);
/*  59 */     ocs.add(AttributeClass.OC_zimbraAccount);
/*     */     
/*  61 */     if (!zimbraDefaultOnly)
/*  62 */       addExtraObjectClasses(ocs, prov, "zimbraAccountExtraObjectClass");
/*  63 */     return ocs;
/*     */   }
/*     */   
/*     */   public static Set<String> getAccountObjectClasses(Provisioning prov) throws ServiceException
/*     */   {
/*  68 */     return getAccountObjectClasses(prov, false);
/*     */   }
/*     */   
/*     */   public static Set<String> getCalendarResourceObjectClasses(Provisioning prov) throws ServiceException
/*     */   {
/*  73 */     Set<String> ocs = new LinkedHashSet();
/*     */     
/*  75 */     ocs.add(AttributeClass.OC_zimbraCalendarResource);
/*     */     
/*  77 */     addExtraObjectClasses(ocs, prov, "zimbraCalendarResourceExtraObjectClass");
/*  78 */     return ocs;
/*     */   }
/*     */   
/*     */   public static Set<String> getCosObjectClasses(Provisioning prov) throws ServiceException
/*     */   {
/*  83 */     Set<String> ocs = new LinkedHashSet();
/*     */     
/*  85 */     ocs.add(AttributeClass.OC_zimbraCOS);
/*     */     
/*  87 */     addExtraObjectClasses(ocs, prov, "zimbraCosExtraObjectClass");
/*  88 */     return ocs;
/*     */   }
/*     */   
/*     */   public static Set<String> getDomainObjectClasses(Provisioning prov) throws ServiceException
/*     */   {
/*  93 */     Set<String> ocs = new LinkedHashSet();
/*     */     
/*  95 */     ocs.add("dcObject");
/*  96 */     ocs.add("organization");
/*  97 */     ocs.add(AttributeClass.OC_zimbraDomain);
/*     */     
/*  99 */     addExtraObjectClasses(ocs, prov, "zimbraDomainExtraObjectClass");
/* 100 */     return ocs;
/*     */   }
/*     */   
/*     */   public static Set<String> getDistributionListObjectClasses(Provisioning prov) throws ServiceException
/*     */   {
/* 105 */     Set<String> ocs = new LinkedHashSet();
/* 106 */     ocs.add(AttributeClass.OC_zimbraDistributionList);
/* 107 */     ocs.add(AttributeClass.OC_zimbraMailRecipient);
/* 108 */     return ocs;
/*     */   }
/*     */   
/*     */   public static Set<String> getGroupObjectClasses(Provisioning prov) throws ServiceException
/*     */   {
/* 113 */     Set<String> ocs = new LinkedHashSet();
/*     */     
/* 115 */     ocs.add("groupOfURLs");
/* 116 */     ocs.add("dgIdentityAux");
/* 117 */     ocs.add(AttributeClass.OC_zimbraGroup);
/*     */     
/*     */ 
/* 120 */     return ocs;
/*     */   }
/*     */   
/*     */   public static Set<String> getGroupDynamicUnitObjectClasses(Provisioning prov) throws ServiceException
/*     */   {
/* 125 */     Set<String> ocs = new LinkedHashSet();
/*     */     
/* 127 */     ocs.add("groupOfURLs");
/* 128 */     ocs.add("dgIdentityAux");
/* 129 */     ocs.add(AttributeClass.OC_zimbraGroupDynamicUnit);
/*     */     
/* 131 */     return ocs;
/*     */   }
/*     */   
/*     */   public static Set<String> getGroupStaticUnitObjectClasses(Provisioning prov) throws ServiceException
/*     */   {
/* 136 */     Set<String> ocs = new LinkedHashSet();
/*     */     
/* 138 */     ocs.add(AttributeClass.OC_zimbraGroupStaticUnit);
/*     */     
/* 140 */     return ocs;
/*     */   }
/*     */   
/*     */   public static Set<String> getServerObjectClasses(Provisioning prov) throws ServiceException
/*     */   {
/* 145 */     Set<String> ocs = new LinkedHashSet();
/*     */     
/* 147 */     ocs.add(AttributeClass.OC_zimbraServer);
/*     */     
/* 149 */     addExtraObjectClasses(ocs, prov, "zimbraServerExtraObjectClass");
/* 150 */     return ocs;
/*     */   }
/*     */   
/*     */   public static Set<String> getAlwaysOnClusterObjectClasses(Provisioning prov) throws ServiceException
/*     */   {
/* 155 */     Set<String> ocs = new LinkedHashSet();
/* 156 */     ocs.add(AttributeClass.OC_zimbraAlwaysOnCluster);
/* 157 */     return ocs;
/*     */   }
/*     */   
/*     */   public static Set<String> getUCServiceObjectClasses(Provisioning prov) throws ServiceException
/*     */   {
/* 162 */     Set<String> ocs = new LinkedHashSet();
/* 163 */     ocs.add(AttributeClass.OC_zimbraUCService);
/* 164 */     return ocs;
/*     */   }
/*     */   
/*     */   public static Set<String> getShareLocatorObjectClasses(Provisioning prov) throws ServiceException
/*     */   {
/* 169 */     Set<String> ocs = new LinkedHashSet();
/* 170 */     ocs.add(AttributeClass.OC_zimbraShareLocator);
/* 171 */     return ocs;
/*     */   }
/*     */   
/*     */ 
/*     */   public static void main(String[] args)
/*     */     throws ServiceException
/*     */   {
/* 178 */     Provisioning prov = Provisioning.getInstance();
/* 179 */     Set<String> ocs = getCalendarResourceObjectClasses(prov);
/*     */     
/* 181 */     for (String oc : ocs) {
/* 182 */       System.out.println(oc);
/*     */     }
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/ldap/LdapObjectClass.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */